﻿<Window x:Class="Fsxget.DlgAirports"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Fsxget" Height="400" Width="700"
	ResizeMode="NoResize"
    >
	<Window.Resources>
		<XmlDataProvider x:Key="MyData" XPath="/Info">
			<x:XData>
				<Info xmlns="">
					<Airport Name="Munich Airport" Code="EDDM" City="Munich" Country="Germany" Show="False" RealIcon="False" Boundaries="False" TaxiSigns="False" />
					<Airport Name="Frankfurt Airport" Code="EDDF" City="Frankfurt" Country="Germany" Show="False" RealIcon="False" Boundaries="False" TaxiSigns="False" />
					<Airport Name="Madrid Barajas" Code="LEMD" City="Madrid" Country="Spain" Show="False" RealIcon="False" Boundaries="False" TaxiSigns="False" />
				</Info>
			</x:XData>
		</XmlDataProvider>

	</Window.Resources>
	<Grid HorizontalAlignment="Stretch">
		<DockPanel Background="White">
			<!--Dialog Title-->
			<Label DockPanel.Dock="Top" Name="LabelHeadline" Style="{StaticResource HeadlinePane}">Airport Display Options</Label>

			<!--Main Section-->
			<StackPanel Margin="20" DockPanel.Dock="Bottom"  Name="MainPanel" Orientation="Vertical" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
				<StackPanel.Resources>
					<Style x:Key="AirportListContainerStyle" TargetType="{x:Type ListViewItem}">
						<Setter Property="HorizontalContentAlignment" Value="Stretch" />
					</Style>
					<Style x:Key="AirportListHeaderStyle" TargetType="{x:Type GridViewColumnHeader}">
						<Setter Property="HorizontalContentAlignment" Value="Left" />
						<Setter Property="Padding" Value="6,0,6,0" />
					</Style>
				</StackPanel.Resources>

				<Grid HorizontalAlignment="Stretch" Margin="0,0,0,15">
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="*" />
						<ColumnDefinition Width="250" />
					</Grid.ColumnDefinitions>
					<Grid.RowDefinitions>
						<RowDefinition />
					</Grid.RowDefinitions>

					<TextBox TextChanged="Tc" Name="TextBoxFilter" Grid.Column="1" Grid.Row="0" HorizontalAlignment="Stretch" Margin="0,0,0,0" Padding="22,2,25,2" HorizontalContentAlignment="Stretch" />
					<Button Name="ButtonSearchCancel" Click="ButtonSearchCancelClick" Grid.Column="1" Grid.Row="0" Height="18" Width="18" Margin="5,0,5,0" Padding="0" BorderBrush="#EEEEEE" BorderThickness="0" HorizontalAlignment="Right" VerticalAlignment="Center" Visibility="Hidden">
						<Image HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0" Stretch="Uniform" Source="pack://application:,,,/Resources/ui_cancel.png" />
					</Button>
					<Image Grid.Column="1" Grid.Row="0" HorizontalAlignment="Left" Margin="5,0,5,0" Stretch="None" Source="pack://application:,,,/Resources/ui_search.png" />
				</Grid>

				<Grid HorizontalAlignment="Stretch" Margin="0,0,0,5">
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="*" />
						<ColumnDefinition Width="Auto" />
					</Grid.ColumnDefinitions>
					<Grid.RowDefinitions>
						<RowDefinition />
					</Grid.RowDefinitions>

					<StackPanel Orientation="Horizontal" Grid.Column="0" Grid.Row="0">
						<Label Margin="0,0,10,0" Padding="0,0,5,0">Show: </Label>
						<RadioButton Name="RadioShowAll" Margin="0,0,10,0" Padding="5,0,5,0" IsChecked="True">All</RadioButton>
						<RadioButton Name="RadioShowActive" Margin="0,0,10,0" Padding="5,0,5,0">Activated Only</RadioButton>
					</StackPanel>

					<StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="0" HorizontalAlignment="Right">
						<Label Grid.Column="1" Grid.Row="0" HorizontalAlignment="Right" Margin="0" Padding="5,0,3,0" FontStyle="Italic">Showing </Label>
						<Label Name="LabelAirportsCurrent" Grid.Column="1" Grid.Row="0" HorizontalAlignment="Right" Margin="0" Padding="3,0,3,0" FontStyle="Italic">#</Label>
						<Label Grid.Column="1" Grid.Row="0" HorizontalAlignment="Right" Margin="0" Padding="3,0,3,0" FontStyle="Italic"> of </Label>
						<Label Name="LabelAirportsTotal" Grid.Column="1" Grid.Row="0" HorizontalAlignment="Right" Margin="0" Padding="3,0,3,0" FontStyle="Italic">#</Label>
						<Label Grid.Column="1" Grid.Row="0" HorizontalAlignment="Right" Margin="0" Padding="3,0,0,0" FontStyle="Italic"> airports</Label>
					</StackPanel>
				</Grid>

				<ListView Name="ListAirports" HorizontalAlignment="Stretch" Height="230" ItemsSource="{Binding Source={StaticResource MyData}, 
                            XPath=Airport}" ItemContainerStyle="{StaticResource AirportListContainerStyle}">
					<ListView.Resources>
						<DataTemplate x:Key="AirportShow">
							<CheckBox IsChecked="{Binding XPath=@Show}" HorizontalAlignment="Center" />
						</DataTemplate>
						<DataTemplate x:Key="AirportRealIcon">
							<CheckBox IsChecked="{Binding XPath=@RealIcon}" HorizontalAlignment="Center"/>
						</DataTemplate>
						<DataTemplate x:Key="AirportBoundaries">
							<CheckBox IsChecked="{Binding XPath=@Boundaries}" HorizontalAlignment="Center"/>
						</DataTemplate>
						<DataTemplate x:Key="AirportTaxiSigns">
							<CheckBox IsChecked="{Binding XPath=@TaxiSigns}" HorizontalAlignment="Center" />
						</DataTemplate>
					</ListView.Resources>
					<ListView.View>
						<GridView ColumnHeaderContainerStyle="{StaticResource AirportListHeaderStyle}">
							<GridViewColumn Width="45" CellTemplate="{StaticResource AirportShow}">Show</GridViewColumn>
							<GridViewColumn Width="120" DisplayMemberBinding="{Binding XPath=@Name}">Aiport Name</GridViewColumn>
							<GridViewColumn Width="55" DisplayMemberBinding="{Binding XPath=@Code}">Code</GridViewColumn>
							<GridViewColumn Width="100" DisplayMemberBinding="{Binding XPath=@City}">City</GridViewColumn>
							<GridViewColumn Width="100" DisplayMemberBinding="{Binding XPath=@Country}">Country</GridViewColumn>
							<GridViewColumn Width="60" CellTemplate="{StaticResource AirportRealIcon}">Real Icon</GridViewColumn>
							<GridViewColumn Width="80" CellTemplate="{StaticResource AirportBoundaries}">Boundaries</GridViewColumn>
							<GridViewColumn Width="60" CellTemplate="{StaticResource AirportTaxiSigns}">Taxi Signs</GridViewColumn>
						</GridView>
					</ListView.View>
				</ListView>
			</StackPanel>
		</DockPanel>
	</Grid>
</Window>
